#include "adddevicelocationgroupdialog.h"

AddDeviceLocationGroupDialog::AddDeviceLocationGroupDialog(QWidget *parent, const QString &oldGroupName)
    : QDialog(parent), m_oldGroupName(oldGroupName)
{
    setupUi();

    layout->addWidget(okButton);
    layout->addWidget(cancelButton);

    setLayout(layout);

    if (!m_oldGroupName.isEmpty()) {
        m_groupNameEdit->setText(m_oldGroupName);  // 如果是修改分组，默认显示原分组名
    }

    connect(okButton, &QPushButton::clicked, this, &AddDeviceLocationGroupDialog::accept);
    connect(cancelButton, &QPushButton::clicked, this, &AddDeviceLocationGroupDialog::reject);
}
